<template>
	<view class="company-tab flex justify-center bg-white text-center">
		<view v-for="(item,index) in title" :class="[{'active':active==index},'padding']" @click="handelTab(index)">
			{{item}}
		</view>
	</view>
</template>

<script setup lang="ts">
import { ref } from 'vue';

withDefaults(
	defineProps<{title:Array<string>}>(),
	{
		title: () => ['关于','职位'],
	})
	
const active = ref<number>(0)
const model = defineModel<number>()
const handelTab = (idx:number)=>{
	active.value = idx,
	model.value = idx
}
</script>

<style lang="scss">
.company-tab{
	border-bottom: 1upx solid #eee;
	view{
		width: 50%;
	}
	.active{
		border-bottom: 2px solid #FD7753;
	}
}
</style>